package com.fastCms.business.frame.enums;

/**
 * 哈密瓜科技 版权所有 © Copyright 2019<br>
 *
 * @Description: 用户类型<br>
 * @Project: hami <br>
 * @CreateDate: Created in 2019/3/7 下午3:48 <br>
 * @Author: <a href="lsquan666@163.com">lsquan</a>
 */
public enum MenuFunctionTypeEnum {
    MENU("MENU", "菜单"),

    POINT("POINT", "功能点");

    private String type;
    private String name;

    MenuFunctionTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public static MenuFunctionTypeEnum getEnum(String type) {
        for (MenuFunctionTypeEnum item : MenuFunctionTypeEnum.values()) {
            if (item.type.equals(type)) {
                return item;
            }
        }
        return null;
    }

    /**
     * 根据code获取name
     *
     * @param type
     * @return
     */
    public static String getName(String type) {
        MenuFunctionTypeEnum item = getEnum(type);
        return item != null ? item.name : null;
    }


    public String getType() {
        return type;
    }

    public void setCode(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


}
